import {axios} from "../../utils/request";

export function addRelationAPI(domain, sourceId, targetId, ship) {
    //添加关系
    return axios({
        url: `/kg/add_relation/${domain}/${sourceId}/${targetId}/${ship}`,
        method: "POST"
    });
}

export function deleteRelationAPI(domain, shipId) {
    //删除关系
    return axios({
        url: `/kg/delete_relation/${domain}/${shipId}`,
        method: "POST"
    });
}

export function updateRelationAPI(domain, shipId, shipName) {
    //修改关系
    return axios({
        url: `/kg/update_relation/${domain}/${shipId}/${shipName}`,
        method: "POST"
    });
}

export function createNodeAPI(domain) {
    //创建节点
    return axios({
        url: `/kg/create_node/${domain}`,
        method: "POST"
    });
}

export function deleteNodeAPI(domain, nodeId) {
    //删除节点
    return axios({
        url: `/kg/delete_node/${domain}/${nodeId}`,
        method: "POST"
    });
}

export function updateNodeNameAPI(domain, nodeId) {
    //修改节点名称
    return axios({
        url: `/kg/update_node_name/${domain}/${nodeId}`,
        method: "POST"
    });
}